package com.xinsoft.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xinsoft.entity.dto.SysReportConfigParam;
import com.xinsoft.entity.po.SysConfig;
import com.xinsoft.entity.po.SysReportConfig;
import com.xinsoft.service.SysReportConfigService;
import com.xinsoft.mapper.SysReportConfigMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
* @author lijie
* @description 针对表【sys_report_config(报表配置表)】的数据库操作Service实现
* @createDate 2023-11-21 10:06:34
*/
@Service
public class SysReportConfigServiceImpl extends ServiceImpl<SysReportConfigMapper, SysReportConfig>
    implements SysReportConfigService{

    @Resource
    SysReportConfigMapper configMapper;

    @Override
    public Object findPageListByParam(SysReportConfigParam param) {
        //分页
        Page<SysReportConfig> page = new Page<SysReportConfig>(param.getCurrentPage(), param.getPageSize());
        LambdaQueryWrapper<SysReportConfig> queryWrapper = new LambdaQueryWrapper<>();
        //查询条件
        queryWrapper
                .like(param.getReportKey()!=null,SysReportConfig::getReportKey,param.getReportKey());
        IPage<SysReportConfig> resultPage = configMapper.selectPage(page, queryWrapper);
        //返回值
        return resultPage;
    }
}




